<template>
  <div>
    <div class="page_title">验收管理{{ }}</div>
    <FormTable :formRules="formRules" :tableData="table.tableData" :columns="table.columns" :total="total"
      :currentPage="queryParams.pageNum" :pageSize="queryParams.pageSize" @changeTableData="changeTableData">
      <template #check="{ slotProps }">
        <el-tag class="ml-2" :type="slotProps.check ? 'success' : 'danger'">
          {{ checkFilter(slotProps.check) }}
        </el-tag>
      </template>
      <template #operator="{ slotProps }">
        <span class="table_button" @click="goToDetail(slotProps)">查看</span>
        <el-divider direction="vertical" />
        <span class="table_button" @click="yanshou(slotProps)">验收结果录入</span>
      </template>
    </FormTable>
  </div>
</template>
<script name="list-two" setup>
import FormTable from "@/components/FormTable/index.vue";
import { useRouter } from "vue-router";
import { queryYanshouList } from '@/api/rzsq'

const router = useRouter();

let total = ref(0);
let queryParams = reactive({ pageNum: 1, pageSize: 10, groups: [], rules: [], orderBys: [] })
onMounted(() => {
  getList()
})
function getList() {
  queryYanshouList(queryParams).then(res => {
    if (res.code == "0") {
      table.tableData = res.data.list
      total.value = res.data.total
    }
  })
}
function queryTable(params) {
  let rules = []
  for (let key in params) {
    let val = params[key]
    val && rules.push(
      {
        field: key,
        data: val,
        opType: "Contains"
      }
    )
  }
  queryParams.rules = rules
  getList()
}
function changeTableData(pageNum,pageSize){
  queryParams.pageNum = pageNum
  queryParams.pageSize = pageSize
  getList()
}
const table = reactive({
  tableData: [{ id: 1 }, { id: 2 }],
  columns: [
    {
      label: "序号",
      type: "index",
      width: '70px'
    },
    {
      label: "申请单位",
      field: "name",
    },
    {
      label: "申请日期",
      field: "email",
    },
    {
      label: "申请单位名称",
      field: "email",
    },
    {
      label: "当前节点",
      field: "email",
    },
    {
      label: "当前状态",
      field: "email",
    },
    {
      label: "联系人",
      field: "email",
    },
    {
      label: "联系电话",
      field: "email",
    },
    {
      prop: 'operator',
      label: "操作",
      field: "email",
      width: '140px'
    },
  ],
  totalRecordCount: 10,
  sortable: {},
});
const formRules = ref([
  {
    type: "input",
    field: "username",
    title: "申请单位",
    value: "",
  },
  {
    type: "datePicker",
    field: "password",
    props: {
      type: "password",
    },
    title: "申请日期",
    value: "",
  },
  {
    type: "input",
    field: "username12",
    title: "申请单位名称",
    value: "",
  },
  {
    type: "input",
    field: "username",
    title: "负责人",
    value: "",
  },
  {
    type: "input",
    field: "username",
    title: "当前状态",
    value: "",
  },
  {
    type: "input",
    field: "username",
    title: "联系人",
    value: "",
  },
  {
    type: "input",
    field: "username",
    title: "联系电话",
    value: "",
  },
]);
// 验收结果录入
const yanshou = () => {

}
// 查看 
const goToDetail = ()=> {
  router.push({ path: "/rzsq/detail" ,query: {tab:'yanshou'}});
}
</script>
<style lang="scss" scoped></style>
